package com.x.ant.dao;

import com.x.ant.model.ChargePolicy;
import com.x.ant.model.City;
import com.x.ant.model.District;
import com.x.ant.model.Province;
import com.x.framework.dao.BaseDao;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class ChargePolicyDao extends BaseDao {
    private final static String selectChargePolicyListSql = "SELECT t1.* FROM ANT_CHARGE_POLICY t1 ";
    public List<ChargePolicy> selectChargePolicyList(ChargePolicy chargePolicy) throws Exception {
        StringBuilder sb = new StringBuilder(selectChargePolicyListSql);
        if (chargePolicy.getChargePolicyState() != null) {
            sb.append("WHERE t1.CHARGE_POLICY_STATE = ? ");
        }
        sb.append("ORDER BY t1.CHARGE_POLICY_CODE");
        return this.queryForList(sb.toString(), ChargePolicy.class);
    }

}
